import request from '@/utils/request'

// 司机列表渲染
export function driverList(params) {
  return request({
    url: '/manager/driver/page',
    method: 'get',
    params
  })
}

// 获取司机基本信息详情
export function getDriverDetails(id) {
  return request({
    url: `/manager/driver/${id}`
  })
}

// 保存司机信息
export function saveDriverApi(data, id) {
  return request({
    url: `/manager/driver/${id}`,
    method: 'put',
    data
  })
}

// 获取司机驾驶证信息
export function getdriverLicense(id) {
  return request({
    url: `/manager/driverLicense/${id}`
  })
}

// 保存司机驾驶证信息
export function saveDriverLicense(data) {
  return request({
    url: `/manager/driverLicense`,
    method: 'post',
    data
  })
}

// 获取已经停用的车辆
export function unWorkingTrucks() {
  return request({
    url: `/manager/unWorkingTrucks`
  })
}

// 获取车辆详情
export function truckDetails(id) {
  return request({
    url: `/manager/truck/${id}`
  })
}

// 车辆绑定司机
export function truckDrivers(driverIds, truckId) {
  return request({
    url: `/manager/truck/truckDrivers`,
    method: 'post',
    data: {
      driverIds, truckId
    }
  })
}
